<template>
	<view class="content">
		<view v-if="!loading" class="record-list">

			<view style="width: 712rpx;margin: 0 auto;margin-top: 23rpx;">
				<uni-table ref="table" border stripe>
					<uni-tr>
						<uni-th width="350rpx" align="center">项目名称</uni-th>
						<uni-th width="120rpx" align="center">检验值</uni-th>
						<uni-th width="170rpx" align="center">参考值</uni-th>


					</uni-tr>
					<uni-tr v-for="(itema, indexa) in dataList" :key="indexa">
						<uni-td align="center">{{ itema.itemName }}</uni-td>
						<uni-td align="center">{{itema.result}}</uni-td>
						<uni-td align="center">{{ itema.range }}</uni-td>

					</uni-tr>
				</uni-table>
			</view>
		</view>
		<u-loading-page :loading="loading" loading-text="加载中..."></u-loading-page>
	</view>
</template>

<script>
	import {
		queryApi
	} from "@/api/user"
	export default {
		data() {
			return {
				loading: true,
				dataList: [],
			}
		},
		onLoad(option) {
			this.getData(option.inReportID, option.inReportClass)
		},
		methods: {
			async getData(inReportID, inReportClass) {
				try {
					this.loading = true
					const res = await queryApi({
						inReportID,
						inReportClass
					})
					this.dataList = res.data
					this.loading = false
				} catch (e) {
					this.loading = false
				}

			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 100vw;
		min-height: 100%;
		box-sizing: border-box;
		background: #F8F8F8;
		color: #666666;
		font-size: 27rpx;
		padding-bottom: calc(23px + env(safe-area-inset-bottom));
		box-sizing: border-box;
		padding-top: 23rpx;
	}

	.record-list {
		width: 730rpx;
		margin: 0 auto;
		border-radius: 19rpx;
		box-sizing: border-box;
		background-color: #FFFFFF;
		padding: 23rpx 0;
		margin-bottom: 23rpx;
	}

	.record-item {
		padding: 0 31rpx;
		box-sizing: border-box;
		display: flex;
		align-items: center;
	}

	.doctor-bom {
		color: #999999;
		font-size: 27rpx;
	}
</style>